package com.sailing.xjpb.log.annotation;

import com.sailing.xjpb.log.util.OperateEnum;

import java.lang.annotation.*;

/**
 * 自定义标识注解
 *
 * @author sutao
 * createDate 2022/9/8 10:51
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface LogAnnotation {

    OperateEnum operateType() default OperateEnum.OTHER;

    String operateModule() default "其他模块";

    boolean recordResult() default false;

    Class<? extends Throwable>[] matchException() default {};

    String[] exceptionCode() default {};

    /**
     * 是否记录body参数
     *
     * @return true:是,false:否
     */
    boolean isRecordRequestBody() default true;

    /**
     * 是否记录query参数
     *
     * @return true:是,false:否
     */
    boolean isRecordQueryParam() default true;
}
